def check(fn):
    def inner():
        print("请先登录")
        fn()
    return inner

# 等价于comment = check(comment)
@check
def comment():
    print("发表评论")

comment()

